Skip to content

feat: PR widget + comments, branch switcher popover, two-column commi…#24

Merged
aletc1 merged 1 commit intodevfrom
claude/angry-vaughan-1b9695
Apr 18, 2026
Merged

feat: PR widget + comments, branch switcher popover, two-column commi…#24
aletc1 merged 1 commit intodevfrom
claude/angry-vaughan-1b9695

Conversation

@aletc1
Copy link
Copy Markdown
Owner

@aletc1 aletc1 commented Apr 18, 2026

Summary

Ships a batch of changelog items + two bug fixes from the UX audit.

Features

  • Two-column commit diff viewer in the History tab: file list on the left, per-file diff on the right, with a draggable splitter whose width persists.
  • PR status widget for the Details sidebar ("pr" widget, off by default) showing number, state, review decision, checks summary, and diff stats.
  • PR comments panel inside the PR widget — fetches issue + review comments via gh pr view --json comments and gh api .../pulls/{n}/comments, with per-comment copy and "Copy all".
  • Editable PR title via a pencil button on the PR row and a rename dialog (gh pr edit <number> --title ...). Passes the number explicitly so a mid-dialog branch switch can't rename the wrong PR.
  • Branch switcher popover in the Changes panel header and the compact Changes widget — searchable, virtualized, with a Carry / Stash & switch / Cancel dialog when the worktree is dirty. changes.checkout now takes uncommittedStrategy: "abort" | "carry" | "stash" and surfaces a clear error if a stash restore fails.
  • Branch badge on the PR row in the Workspace widget + PR activity badge in chat messages (extracted from gh pr create --head or gh's preamble).
  • PR number on the sidebar workspace card. getPrStatus now back-fills chat.prNumber / chat.prUrl into the DB so the sidebar can render the badge from cached fields.
  • "Open in editor" row now shows for any local chat with a repo path (project or worktree), not just worktrees under ~/.21st/worktrees/.

Bug fixes

  • VS Code button: open -a "Visual Studio Code" silently failed on brew-only / CLI-only installs because the spawnAsync helper resolved before the child's error event. New openPathInApp tries the editor's CLI first (code, cursor, subl, JetBrains launchers…) via execWithShellEnv so macOS GUI PATH is honored, awaits the spawn event, and falls back to open -a only when the CLI isn't on PATH. Added an onError toast in the Workspace widget.
  • Terminal opens in ~: the first mount of <Terminal> could race the chat load and send cwd: undefined to the main process, which fell back to os.homedir() and cached that session forever. Renderer now skips createOrAttach until initialCwd || cwd is truthy; main-side logs a clear warning on any remaining fallback.

Test plan

  • VS Code button — Workspace widget → "Open in VS Code" launches the worktree/project folder. Negative path: rename code binary and retry → toast appears (no silent failure).
  • Terminal cwd — open Terminal widget → pwd matches the worktree path, not ~. Switch chats → each terminal starts in its own worktree.
  • Branch switcher — click the branch pill on the Changes widget and the expanded Changes header → searchable popover opens. With a clean worktree, selecting a branch checks out immediately. With dirty changes: dialog appears → "Stash & switch" preserves the edit on the new branch; checkout failure surfaces a toast telling the user their changes are in git stash.
  • Editable PR title — pencil icon next to the PR row → rename dialog → save → title updates on GitHub within one poll (30s) and in the UI.
  • PR widget — enable via "Edit widgets" → shows #/title/state/review/checks/+/−. Toggle "Show comments" → issue and review comments render with author, timestamp, file path + diff hunk (for review comments). "Copy all" and per-comment copy both work.
  • Two-column commit diff — History tab → select a multi-file commit → files on the left, diff on the right, drag the splitter, click between files → diff swaps. Reload → split width persists.
  • Sidebar PR badge — after the PR widget fetches once, the workspace card shows ⌥ #<num> before the stats.
  • Branch badge on PR row — Workspace widget PR row shows a branch pill; in-chat PR activity badge does the same after gh pr create.
  • Typecheck clean (bun run tsc --noEmit); build clean (bun run build).

🤖 Generated with Claude Code

…t diff, VS Code/terminal fixes

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@aletc1 aletc1 merged commit ff0af9b into dev Apr 18, 2026
@aletc1 aletc1 deleted the claude/angry-vaughan-1b9695 branch April 18, 2026 15:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant